#pragma once
#include <Windows.h>
#include<vector>
#include<thread>
#include"Track.h"
#pragma comment(lib,"winmm.lib")
class Midi
{
public:
	Midi();
	virtual ~Midi();
	void program_change(int program, int channel);
	void note_on(int note, int volume, int channel, int time);
	void note_off(int note, int volume, int channel, int time);
	void play_track(Track track);
	void play();
	void write_file(const char* file_path);
	int midi_time();
	int tracks_num();
	std::thread play_thread[16];
	Track tracks[16];
	

protected:
	HMIDIOUT handle;
	//void append_track(Track track);
};

